#include<bits/stdc++.h>
using ll= unsigned long long;
using namespace std;

const int MOD=1e9+7;


void solve(){
	ll n,k;
	cin>>n>>k;
	vector<pair<ll,int>> vec;
	ll tot=0;
	for(int i=0;i<k;i++){
		ll a,b;
		cin>>a>>b;
		vec.push_back({a,b});
		tot+=a;
	}
	ll m=n;
	int len=0;
	while(m>2){
		m=(m+1)/2;
		len++;
	}
	ll d=1ll<<len;
	
	ll sum_x=0,sum_y=0;
	ll s=0;
	for(auto& v:vec){
		ll a=v.first;
		ll b=v.second;
		ll L=s;
		ll R=s+a-1;
		s+=a;
	}
}

int main(){
	int t=1;
//	cin>>t;
	while(t--){
		solve();
	}
	return 0;
} 
